<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>事件的基本使用</title>
  <script type="text/javascript" src="../JS/vue.js"></script>
</head>

<body>
  <div id="root">
    <h2>欢迎来到{{name}}学习</h2>
    <button @click="showName">点我提示姓名</button>
    <button @click="showMessage(66,$event)">点我提示消息</button>
  </div>
</body>
<script type="text/javascript">
  Vue.config.productionTip = false
  const vm = new Vue({
    el: '#root',
    data: {
      name: '尚硅谷'
    },
    methods: {
      showName() {
        alert(this.name)
      },
      showMessage(number, a) {
        alert(number)
      }
    }
  })
</script>

</html>